package com.example.threadlocal.transmitParams;

/**
 * create by mwh 2021-11-16
 **/

public class TransmitHeadParamTest {
    public void method1(HeaderParam headerParam){
        System.out.println("method1---------"+headerParam);
    }

    private void method4() {
        //TODO 需要拿取headerparam的值
        System.out.println("this is method4---");
        HeaderParam headerParam =  ThreadLocalHeadParam.getThreadLocal();
        System.out.println("headerParam is :"+headerParam);
    }

    private void method3() {
        System.out.println("this is method3---");
    }

    private void method2() {
        System.out.println("this is method2---");
    }

    public static void main(String[] args) {
        HeaderParam headerParam = new HeaderParam();
        headerParam.setAppkey("myappkey");
        headerParam.setUid("123");


        ThreadLocalHeadParam.setThreadLocal(headerParam);

        TransmitHeadParamTest instance = new TransmitHeadParamTest();
        instance.method1(headerParam);

        instance.method2();
        instance.method3();
        instance.method4();
    }
}
